home *** CD-ROM | disk | FTP | other *** search
- % -----------------------------------------------------------------------------
- % Mouse demonstration script *TERMINATE PRESCRIPTION*
- % -----------------------------------------------------------------------------
- %
- % Version : 1.00
- % Filename : MOUSE.TSL
- % Company : SerWiz Comm
- % Programmer : Joop Blokker and Bo Bendtsen
- % Module created : 14 Aug 1995
- % Latest revision : 14 Aug 1995
- % Language/version : Terminate Prescription 1.00
- % Remarks : Demonstrates most mouse functions
- %
- % -----------------------------------------------------------------------------
-
- If MouseDetected=0
- PrintLn "No mouse detected, please install mouse driver"
- Waitenter
- TERMINATE
- Endif
-
- Window 1,1,80,25,1,0,23,23,27," Mouse test "
- MouseWindow 2,2,79,24
-
- Mouse 1
- Set OldX = 0
- Set OldY = 0
- Set Counter1 = 0 % count changes
- Set Counter2 = 0 % count other
-
- GotoXY 20,1
- Print "Click Right Mouse Button to exit, Left to fire lasergun"
-
- repeat
- Set X = MouseX
- Set Y = MouseY
-
- If (X <> OldX) | (Y <> OldY)
- gosub Report
- else
- Set Counter2 = Counter2 + 1
- GotoXY 1,4
- Print Counter2
- EndIf
-
- If MouseLeft=1
- WriteStr X,Y,"X"
- Sound 1000
- Wait 10
- NoSound
- Endif
-
- Until (MouseRight=1) | (keypressed=1)
- RemoveWindow
- TERMINATE
-
- :Report
- GotoXY 1,1
- print OldX, " ",OldY," "
-
- GotoXY 1,2
- print X, " ",Y," "
-
- Set Counter1 = Counter1 + 1
- GotoXY 1,3
- print Counter1
-
- Set OldX=X
- Set OldY=Y
-
- Return
-
-